473,421 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

PHP compressor

I'm looking for PHP code for compressing another PHP code.
Is there any solutions for free download?

It would be good if it can compress JS and CSS too.

Would there be significant speed improvement by compresing an PHP script?

Thank you!
Aug 21 '06 #1
4 7587
On Tue, 22 Aug 2006 00:14:38 +0200, Gale <ga**@rules.dawrote:
>I'm looking for PHP code for compressing another PHP code.
Is there any solutions for free download?

It would be good if it can compress JS and CSS too.

Would there be significant speed improvement by compresing an PHP script?
Compressing a PHP script would more likely slow things down, since it'd just
have to be decompressed by the server again. If you want to speed up PHP,
you'll get better results from a bytecode cache, such as APC, or the Zend
product.

If by compression you mean simply removing any redundant whitespace and
comments, I would expect very tiny gains in performance; nothing like what
you'd get from a bytecode compiler (which effectively does that, and
considerably more).

Compressing JS and CSS is potentially a different matter; you can get some
gains there because you reduce the amount of data sent over the network to the
client. Depends where the bottleneck is; for small files over a fast network it
won't help. You're probably best off getting your webserver to do this for you;
for Apache, see mod_deflate.

In a similar way you can also get PHP to compress the _output_ of the script,
by setting zlib.output_compression in php.ini (amongst other ways).

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Aug 21 '06 #2
Gale wrote:
I'm looking for PHP code for compressing another PHP code.
Is there any solutions for free download?

It would be good if it can compress JS and CSS too.

Would there be significant speed improvement by compresing an PHP script?
PHP files are parsed by the PHP engine (e.g. Zend) and executed.
Decreasing the physical size of the file will not make it 'faster'.

If you want to minimize the download size of all the server output,
then use a JS and CSS compressor. You can also use ZLib
(http://us2.php.net/zlib) on the server side to compress the data being
output.

Aug 21 '06 #3
Thank you both for your answers
Aug 22 '06 #4
Gale wrote:
I'm looking for PHP code for compressing another PHP code.
Is there any solutions for free download?

It would be good if it can compress JS and CSS too.

Would there be significant speed improvement by compresing an PHP script?
Not sure, if you are looking for:
1. http://www.schroepl.net/projekte/mod_gzip/
2. http://in2.php.net/ob_gzhandler

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Aug 26 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ian Stirling | last post by:
I'm playing with downloading javascript to my phone, over the providers email service. It's rather slow. Is there anything that will compress javascript, doing things like reducing identifiers...
0
by: Bartosz Wójcik | last post by:
..netshrink - is an executable compressor for managed files. It uses LZMA compression library and can decrease your file size by 50%. It can also protect your files with a password. ..netshrink...
2
by: Eyal Lotem | last post by:
Hey. I have a problem in some network code. I want to send my packets compressed, but I don't want to compress each packet separately (via .encode('zlib') or such) but rather I'd like to...
34
by: davehowey | last post by:
I have a problem. I'm writing a simulation program with a number of mechanical components represented as objects. When I create instances of objects, I need to reference (link) each object to the...
6
by: erick-flores | last post by:
Hello, I want to make a report for a single compressor. Instead of showing a report for all the compressors. I would like to place a button in the compressor form, so whenever I want to display a...
2
by: erick-flores | last post by:
Hello all Form A (pk) & Form B (fk) I want to display my Form B empty whenever is the first time, that the pk form Form A, is enter. I click a button to open Form B. BUT if the pk from Form A...
1
by: arunraj2002in | last post by:
i want to write a c program --- compressor / de-compressor of a file which contains characters ‘1’,’2’, - - - ’F’. Compression should achieve at least 50% less size. Please help..
7
by: Hulm1 | last post by:
Two check boxes on the same form. I need to make check box 2 = TRUE if Check one is clicked (and so made TRUE) The following code does not work Private Sub AirSparging_AfterUpdate() If...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.